package com.shylock.common.util;


import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;


public class DateUtil {
    /**
     * @description: 获取当前时间加上指定日的日期
     * @return:
     */
    public static String getDate(int days){
        Calendar calendar=Calendar.getInstance();
        calendar.add(Calendar.DAY_OF_MONTH,days);
        return new SimpleDateFormat("yyyy-MM-dd").format(calendar.getTime());
    }
    /**
     * @description: 获取当前时间加上指定日的日期
     * @return:
     */
    public static Date getDateYear(int years){
        Calendar calendar=Calendar.getInstance();
        calendar.add(Calendar.YEAR,years);
        return calendar.getTime();
    }
}